//
//  Download.h
//  DownLoadDemo
//
//  Created by xalo on 16/6/17.
//  Copyright © 2016年 xmaz. All rights reserved.
//

#import <Foundation/Foundation.h>
//正在下载
typedef void(^Downloading)(long long bytesWritten , float progress);
//下载完成
typedef void(^Complted)(NSString *filePath , NSString *url);

@interface Download : NSObject

//自定义  初始化的时候 创建一个下载任务
- (instancetype)initWithUrl:(NSURL *)url;

//开始下载
- (void)startDownload;

//暂停下载
-(void)stopDownload;

//下载时候和下载完成会走其中的block
-(void)downloading:(Downloading)downloading didFinished:(Complted)complted;

@end
